package com.yhy.wxzn.wms.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yhy.wxzn.wms.entity.WmsInboundConfig;
import com.yhy.wxzn.wms.entity.WmsInboundDetail;
import com.yhy.wxzn.wms.mapper.WmsInboundConfigMapper;
import com.yhy.wxzn.wms.service.IWmsInboundConfigService;
import com.yhy.wxzn.wms.service.IWmsInboundDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @Description: 入库业务配置
 * @Author: jeecg-boot
 * @Date:   2023-11-02
 * @Version: V1.0
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class WmsInboundConfigServiceImpl extends ServiceImpl<WmsInboundConfigMapper, WmsInboundConfig> implements IWmsInboundConfigService {

    @Autowired
    private IWmsInboundDetailService inboundDetailService;

    @Override
    public void removeOutConfigBatch(List<String> inboundIds) {
        LambdaQueryWrapper<WmsInboundDetail> wrapper = new LambdaQueryWrapper<>();
        wrapper.in(WmsInboundDetail::getInboundId,inboundIds);
        inboundDetailService.remove(wrapper);
        this.removeByIds(inboundIds);
    }
}
